<?php

function smarty_function_get_carpropertyname_by_id($params, &$smarty) {
    //Get value from page
    $id = $params['id'];

    if($id){
      //Query data

      //Check exist user & topic
      $pntables = pnDBGetTables();
      $table  = $pntables['icarrent_carproperty'];
      $column = $pntables['icarrent_carproperty_column'];

      $sql = "SELECT
                $table.$column[name]
              FROM
                $table
              WHERE
                $table.$column[id] = ".$id;

      $column = array("name");
      $result = DBUtil::executeSQL($sql);
      $objectArray = DBUtil::marshallObjects ($result, $column);
      //var_dump($objectArray); exit;
      $car_property = $objectArray['0']['name'];
    }
    return $car_property;

}